<?php

/**
 * Pracownicy form base class.
 *
 * @method Pracownicy getObject() Returns the current form's model object
 *
 * @package    testyZlecenia
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasePracownicyForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                      => new sfWidgetFormInputHidden(),
      'imiepracownika'          => new sfWidgetFormInputText(),
      'nazwiskopracownika'      => new sfWidgetFormInputText(),
      'email'                   => new sfWidgetFormInputHidden(),
      'telefonwewn'             => new sfWidgetFormInputText(),
      'telefonkom'              => new sfWidgetFormInputText(),
      'dzialy_id'               => new sfWidgetFormInputText(),
      'stanowiska_id'           => new sfWidgetFormInputText(),
      'kierownik_pracownicy_id' => new sfWidgetFormInputText(),
      'zatrudniony_aktywny'     => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'                      => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'imiepracownika'          => new sfValidatorString(array('max_length' => 100)),
      'nazwiskopracownika'      => new sfValidatorString(array('max_length' => 200)),
      'email'                   => new sfValidatorChoice(array('choices' => array($this->getObject()->get('email')), 'empty_value' => $this->getObject()->get('email'), 'required' => false)),
      'telefonwewn'             => new sfValidatorInteger(array('required' => false)),
      'telefonkom'              => new sfValidatorInteger(array('required' => false)),
      'dzialy_id'               => new sfValidatorInteger(array('required' => false)),
      'stanowiska_id'           => new sfValidatorInteger(),
      'kierownik_pracownicy_id' => new sfValidatorInteger(array('required' => false)),
      'zatrudniony_aktywny'     => new sfValidatorInteger(),
    ));

    $this->widgetSchema->setNameFormat('pracownicy[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Pracownicy';
  }

}
